package com.zlsy.springbootdemo.memory;

/**
 * @author zhouliang
 * @date 2021/01/25
 **/
public class SlotTest {
    public static void main(String[] args) {
        {
            byte[] bs = new byte[2 * 1024 * 1024];
        }

        int a =5;

        System.gc();

        System.err.println("totalMemory:" + Runtime.getRuntime().totalMemory() / 1024.0 / 1024);
        System.err.println("freeMemory:" + Runtime.getRuntime().freeMemory() / 1024.0 / 1024);
        System.err.println("maxMemory:" + Runtime.getRuntime().maxMemory() / 1024.0 / 1024);
    }
}
